package com.hxy.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.hxy.dao.*;
import com.hxy.pojo.*;

import com.hxy.pojo.model.BranchDatas;
import com.hxy.pojo.vo.BranchVo;
import com.hxy.service.StaticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class StaticServiceImp implements StaticService {
    @Autowired
    private FolkMapper folkMapper;
    @Autowired
    private EstatusMapper EStatusMapper;
    @Autowired
    private BusinessMapper businessMapper;

    @Autowired
    private KulturMapper kulturMapper;
    @Autowired
    private VisageMapper visageMapper;
    @Autowired
    private StuffinfoMapper stuffinfoMapper;
    @Override
    public PageInfo<Folk> selectAllFolk(Integer pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Folk> folks = folkMapper.selectAll();
        PageInfo<Folk> folkPageInfo = new PageInfo<>(folks);
        return folkPageInfo;
    }
    @Override
    public PageInfo<Business> selectAllPagerBusiness(Integer pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Business> Business = businessMapper.selectAll();
        PageInfo<Business> BusinessPageInfo = new PageInfo<>(Business);
        return BusinessPageInfo;
    }



    @Override
    public PageInfo<Kultur> selectAllPagerKultur(Integer page, int limit) {
        PageHelper.startPage(page, limit);
        List<Kultur> kulturs = kulturMapper.selectAll();
        PageInfo<Kultur> kultursPageInfo = new PageInfo<>(kulturs);
        return kultursPageInfo;
    }



    @Override
    public PageInfo<Visage> selectAllPagerVisage(Integer page, int limit) {
        PageHelper.startPage(page, limit);
        List<Visage> visages = visageMapper.selectAll();
        PageInfo<Visage> visagesPageInfo = new PageInfo<>(visages);
        return visagesPageInfo;
    }

    @Override
    public PageInfo<Estatus> selectEstatusAll(Integer pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Estatus> Estatuss = EStatusMapper.selectAll();
        PageInfo<Estatus> EstatusPageInfo = new PageInfo<>(Estatuss);
        return EstatusPageInfo;

    }

}
